package com.industrial.premu.service.impl;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.industrial.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.industrial.premu.mapper.PremuPioneerCompanyMapper;
import com.industrial.premu.domain.PremuPioneerCompany;
import com.industrial.premu.service.IPremuPioneerCompanyService;

/**
 * 亩产先锋企业Service业务层处理
 * 
 * @author ZHOUS
 * @date 2024-03-28
 */
@Service
public class PremuPioneerCompanyServiceImpl implements IPremuPioneerCompanyService 
{
    @Autowired
    private PremuPioneerCompanyMapper premuPioneerCompanyMapper;

    /**
     * 查询亩产先锋企业
     * 
     * @param baseId 亩产先锋企业主键
     * @return 亩产先锋企业
     */
    @Override
    public PremuPioneerCompany selectPremuPioneerCompanyByBaseId(String baseId)
    {
        return premuPioneerCompanyMapper.selectPremuPioneerCompanyByBaseId(baseId);
    }

    /**
     * 查询亩产先锋企业列表
     * 
     * @param premuPioneerCompany 亩产先锋企业
     * @return 亩产先锋企业
     */
    @Override
    public List<PremuPioneerCompany> selectPremuPioneerCompanyList(PremuPioneerCompany premuPioneerCompany)
    {
        return premuPioneerCompanyMapper.selectPremuPioneerCompanyList(premuPioneerCompany);
    }

    /**
     * 新增亩产先锋企业
     * 
     * @param premuPioneerCompany 亩产先锋企业
     * @return 结果
     */
    @Override
    public int insertPremuPioneerCompany(PremuPioneerCompany premuPioneerCompany)
    {
        premuPioneerCompany.setCreateTime(DateUtils.getNowDate());
        return premuPioneerCompanyMapper.insertPremuPioneerCompany(premuPioneerCompany);
    }

    /**
     * 修改亩产先锋企业
     * 
     * @param premuPioneerCompany 亩产先锋企业
     * @return 结果
     */
    @Override
    public int updatePremuPioneerCompany(PremuPioneerCompany premuPioneerCompany)
    {
        return premuPioneerCompanyMapper.updatePremuPioneerCompany(premuPioneerCompany);
    }

    /**
     * 批量删除亩产先锋企业
     * 
     * @param baseIds 需要删除的亩产先锋企业主键
     * @return 结果
     */
    @Override
    public int deletePremuPioneerCompanyByBaseIds(String[] baseIds)
    {
        return premuPioneerCompanyMapper.deletePremuPioneerCompanyByBaseIds(baseIds);
    }

    /**
     * 删除亩产先锋企业信息
     * 
     * @param baseId 亩产先锋企业主键
     * @return 结果
     */
    @Override
    public int deletePremuPioneerCompanyByBaseId(String baseId)
    {
        return premuPioneerCompanyMapper.deletePremuPioneerCompanyByBaseId(baseId);
    }

    @Override
    public List<Map<String, BigDecimal>> queryTop15Industry() {
        List<Map<String, BigDecimal>> r = premuPioneerCompanyMapper.queryTop15Industry();
        return r;
    }

    @Override
    public List<PremuPioneerCompany> companyTop10(PremuPioneerCompany premuPioneerCompany) {
        return premuPioneerCompanyMapper.companyTop10(premuPioneerCompany);
    }
}
